<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNetworkService</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="resolver.html" title="DNS resolution">
<link rel="prev" href="GNetworkAddress.html" title="GNetworkAddress">
<link rel="next" href="GSrvTarget.html" title="GSrvTarget">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GNetworkAddress.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="resolver.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GSrvTarget.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GNetworkService.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GNetworkService.description" class="shortcut">Description</a>
                   | 
                  <a href="#GNetworkService.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#GNetworkService.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#GNetworkService.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="GNetworkService"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GNetworkService.top_of_page"></a>GNetworkService</span></h2>
<p>GNetworkService — A GSocketConnectable for resolving SRV records</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GNetworkService.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="GNetworkService.html#GNetworkService-struct" title="GNetworkService">GNetworkService</a>;
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> * <a class="link" href="GNetworkService.html#g-network-service-new" title="g_network_service_new ()">g_network_service_new</a>              (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *service</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *protocol</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);
const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="GNetworkService.html#g-network-service-get-service" title="g_network_service_get_service ()">g_network_service_get_service</a>       (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);
const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="GNetworkService.html#g-network-service-get-protocol" title="g_network_service_get_protocol ()">g_network_service_get_protocol</a>      (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);
const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="GNetworkService.html#g-network-service-get-domain" title="g_network_service_get_domain ()">g_network_service_get_domain</a>        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);
const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="GNetworkService.html#g-network-service-get-scheme" title="g_network_service_get_scheme ()">g_network_service_get_scheme</a>        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GNetworkService.html#g-network-service-set-scheme" title="g_network_service_set_scheme ()">g_network_service_set_scheme</a>        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *scheme</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GNetworkService.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----GNetworkService
</pre>
</div>
<div class="refsect1">
<a name="GNetworkService.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GNetworkService implements
 <a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a>.</p>
</div>
<div class="refsect1">
<a name="GNetworkService.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="GNetworkService.html#GNetworkService--domain" title='The "domain" property'>domain</a>"                   <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="GNetworkService.html#GNetworkService--protocol" title='The "protocol" property'>protocol</a>"                 <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="GNetworkService.html#GNetworkService--scheme" title='The "scheme" property'>scheme</a>"                   <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write
  "<a class="link" href="GNetworkService.html#GNetworkService--service" title='The "service" property'>service</a>"                  <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1">
<a name="GNetworkService.description"></a><h2>Description</h2>
<p>
Like <a class="link" href="GNetworkAddress.html" title="GNetworkAddress"><span class="type">GNetworkAddress</span></a> does with hostnames, <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.
</p>
<p>
See <a class="link" href="GSrvTarget.html" title="GSrvTarget"><span class="type">GSrvTarget</span></a> for more information about SRV records, and see
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> for and example of using the connectable
interface.
</p>
</div>
<div class="refsect1">
<a name="GNetworkService.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GNetworkService-struct"></a><h3>GNetworkService</h3>
<pre class="programlisting">typedef struct _GNetworkService GNetworkService;</pre>
<p>
A <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> for resolving a SRV record and connecting to
that service.
</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-new"></a><h3>g_network_service_new ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> * g_network_service_new              (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *service</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *protocol</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre>
<p>
Creates a new <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> representing the given <em class="parameter"><code>service</code></em>,
<em class="parameter"><code>protocol</code></em>, and <em class="parameter"><code>domain</code></em>. This will initially be unresolved; use the
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> interface to resolve it.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td>the service type to look up (eg, "ldap")</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>protocol</code></em> :</span></p></td>
<td>the networking protocol to use for <em class="parameter"><code>service</code></em> (eg, "tcp")</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the DNS domain to look up the service in</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GNetworkService]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-service"></a><h3>g_network_service_get_service ()</h3>
<pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_network_service_get_service       (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>
Gets <em class="parameter"><code>srv</code></em>'s service name (eg, "ldap").
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>srv</code></em> :</span></p></td>
<td>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>srv</code></em>'s service name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-protocol"></a><h3>g_network_service_get_protocol ()</h3>
<pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_network_service_get_protocol      (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>
Gets <em class="parameter"><code>srv</code></em>'s protocol name (eg, "tcp").
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>srv</code></em> :</span></p></td>
<td>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>srv</code></em>'s protocol name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-domain"></a><h3>g_network_service_get_domain ()</h3>
<pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_network_service_get_domain        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>
Gets the domain that <em class="parameter"><code>srv</code></em> serves. This might be either UTF-8 or
ASCII-encoded, depending on what <em class="parameter"><code>srv</code></em> was created with.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>srv</code></em> :</span></p></td>
<td>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>srv</code></em>'s domain name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-scheme"></a><h3>g_network_service_get_scheme ()</h3>
<pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_network_service_get_scheme        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>
Get's the URI scheme used to resolve proxies. By default, the service name
is used as scheme.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>srv</code></em> :</span></p></td>
<td>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>srv</code></em>'s scheme name</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-set-scheme"></a><h3>g_network_service_set_scheme ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_network_service_set_scheme        (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>,
                                                         <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *scheme</code></em>);</pre>
<p>
Set's the URI scheme used to resolve proxies. By default, the service name
is used as scheme.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>srv</code></em> :</span></p></td>
<td>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scheme</code></em> :</span></p></td>
<td>a URI scheme</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
</div>
<div class="refsect1">
<a name="GNetworkService.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GNetworkService--domain"></a><h3>The <code class="literal">"domain"</code> property</h3>
<pre class="programlisting">  "domain"                   <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>Network domain, eg, "example.com".</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--protocol"></a><h3>The <code class="literal">"protocol"</code> property</h3>
<pre class="programlisting">  "protocol"                 <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>Network protocol, eg "tcp".</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--scheme"></a><h3>The <code class="literal">"scheme"</code> property</h3>
<pre class="programlisting">  "scheme"                   <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write</pre>
<p>Network scheme (default is to use service).</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--service"></a><h3>The <code class="literal">"service"</code> property</h3>
<pre class="programlisting">  "service"                  <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>Service name, eg "ldap".</p>
<p>Default value: NULL</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>